from app.models.repairrequest import Repairrequest
from app.extensions import db

#insert code here to create a user

def add_repairRequest(id, username,propertyid,description,phone,usernameowner):
    repairRequest = Repairrequest(id = id,username=username, propertyid=propertyid,description=description,phone=phone,usernameowner=usernameowner)
    db.session.add(repairRequest)
    db.session.commit()
    return repairRequest

def get_repairRequest(username):
    repairRequest = Repairrequest.query.filter_by(usernameowner=username).all()
    return repairRequest